package com.drinks.yiniang.utils;

import com.hansen.library.utils.StringUtils;

/**
 * @author han
 * @date 2019/12/11
 */
public class RegularUtils {

    private static String QR_CODE_GOODS_ID = "http://www.1brew.cn/api/scan/goods/detail?goods_id=";

    //获取携带商品的id二维码, https://www.1brew.cn/api/scan/goods/detail?goods_id=46
    public static String getGoodsQrCodeScanResult(String url) {
        if(StringUtils.isEmpty(url)) {
            return null;
        }

        if(url.startsWith(QR_CODE_GOODS_ID)) {
            return url.replace(QR_CODE_GOODS_ID,"");
        }

        return null;
    }
}
